<template>
  <div class="green">
    <button @click="send">发送</button>
  </div>
</template>
<script>
import bus from './bus.js'
export default {
  data () {
    return {
      user: { name: 'zhangsan', age: 19 }
    }
  },
  methods: {
    send () {
      bus.$emit('sendData', this.user)
    }
  }
}
</script>

<style lang="less" scoped>
.green {
  flex: 1;
  background: green;
}
</style>